package com.sophialex.health.record.lktable.traverse;

import org.eclipse.swt.graphics.Point;

import com.sophialex.health.person.vo.HrPerson;
import com.sophialex.health.record.ui.baseinfo.FamilyUI;
import com.sophialex.health.system.lktable.LKTable;
import com.sophialex.health.system.lktable.LKTraverseStrategy;
/**
 * 
 * <p>Title:Health</p>
 * <p>FamilyTraverseStrategy</p>
 * 
 * Alex Apr 28, 2011 10:08:57 AM create
 * @author <a href='wanghao924@126.com'>Alex</a>
 * QQ: 873987060;
 * @version 1.0
 */
public class FamilyTraverseStrategy extends LKTraverseStrategy {
	private LKTable lkTable;
	private FamilyUI view;
	private Object obj;
	public FamilyTraverseStrategy(LKTable lkTable, FamilyUI view) {
		this.lkTable = lkTable;
		this.view = view;
	}
	
	public Point getNextStation(int keyCode, LKTable table, int index,
			Object obj, int col, String feild, int stateMask) {
		this.obj = obj;
		if(col+1>=table.getColumnCount()){
			return new Point(0,index+1);
		}
		return new Point(col+1,index);
	}

	
	public boolean newLine() {
		if (obj.getClass() == HrPerson.class)
			return view.doCheck((HrPerson) obj);
		return false;
	}
	
}
